package com.example.myui.activity.service;

import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.support.annotation.Nullable;
import android.util.Log;

/**
 * Created by Administrator on 2018/3/14/014.
 */

public class BindService extends Service implements IPlayer {
    private static final String TAG = BindService.class.getSimpleName();
    private MyBinder binder = new MyBinder();

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        Log.i(TAG, "onBind: " + intent.getStringExtra("bind"));
        return binder;
    }

    @Override
    public void onCreate() {
        super.onCreate();
    }

    @Override
    public void play() {
        Log.i(TAG, "play: ");
    }

    @Override
    public void pause() {
        Log.i(TAG, "pause: ");
    }

    @Override
    public void stop() {
        Log.i(TAG, "stop: ");
    }

    @Override
    public int getProgress() {
        return 100;
    }

    @Override
    public int getDuration() {
        return 10240;
    }

    public class MyBinder extends Binder {
        public BindService getService() {
            return BindService.this;
        }
    }
}
